package com.wwmz.mebatis.v1.config;

import java.lang.reflect.Proxy;
import java.util.ResourceBundle;

/**
 * Created by wumz on 2020/10/14 15:11
 */
public class MyConfiguration {

    public static final ResourceBundle sqlMappings;

    static {
        sqlMappings = ResourceBundle.getBundle("sql");
    }

    public <T> T getMapper(Class<T> clazz, MySqlSession sqlSession) {
        return (T) Proxy.newProxyInstance(
                this.getClass().getClassLoader(),
                new Class[]{clazz},
                new MyMapperProxy(sqlSession)
        );
    }
}
